﻿using Mt.Site.Core.WorkFlows.Design;
using Mt.Site.Core.WorkFlows.Design.Cache;
using System;
using System.Collections.Generic;

namespace Mt.Site.Core.WorkFlows
{
    /// <summary>
    /// 流程定义
    /// </summary>
    public interface IWorkflowDefinition
    {
        IWorkFlowCacheItem Definition { get; }

        /// <summary>
        /// 未找到则返回null
        /// </summary>
        /// <param name="nodeId"></param>
        /// <returns></returns>
        IWorkflowNodeDefinition FindNode(Guid nodeId);

        /// <summary>
        /// 未找到则返回null
        /// </summary>
        /// <param name="nodeId"></param>
        /// <returns></returns>
        IWorkflowNodeDefinition FindNode(string nodeName);

        /// <summary>
        /// 获取第一个处理过程（一般是拟稿环节）,未找到则返回null
        /// </summary>
        /// <returns></returns>
        IWorkflowNodeDefinition FirstNode { get; }

        /// <summary>
        /// 已过滤未找到的项
        /// </summary>
        /// <param name="idList"></param>
        /// <returns></returns>
        List<IWorkflowNodeDefinition> GetNodeList(List<Guid> idList);
    }
}
